package com.pn.taikao.mapper;

import com.pn.taikao.entity.Course;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface CourseMapper {
    int insert(Course course);

    int update(Course course);

    int deleteById(@Param("id") Long id);

    Course selectById(@Param("id") Long id);

    Course selectByName(@Param("name") String name);

    Course selectByCourseCode(@Param("courseCode") String courseCode);

    List<Course> selectByTeacherId(@Param("teacherId") Long teacherId);

    List<Course> selectByCollegeId(@Param("collegeId") Long collegeId);

    List<Course> selectPage(@Param("name") String name,
                            @Param("teacherId") Long teacherId,
                            @Param("collegeId") Long collegeId,
                            @Param("offset") int offset,
                            @Param("limit") int limit);

    long count(@Param("name") String name,
               @Param("teacherId") Long teacherId,
               @Param("collegeId") Long collegeId);
}



